<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <title>面积调剂</title>
    <#include "../common/common.ftl"/>
</head>
<body>
<div>
    <input type="hidden" name="contractId" value="${(contract.id)!}"/>
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-header">一、被动迁人基本信息</div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        征收项目：${(contract.zsProject.projectName)!}
                    </div>
                    <div class="layui-col-xs6">
                        所在工作组：${(groupMap[contract.groupCode].name)!}
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        被动迁人：${(contract.name)!}
                    </div>
                    <div class="layui-col-xs6">
                        身份证号：${(contract.idCard)!}
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        协议编号：${(contract.contractCode)!}
                    </div>
                    <div class="layui-col-xs6">
                        总可选房面积：${(contract.limitHouseAreaTotal)!}㎡
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-header">二、选择调剂转入方</div>
            <div class="layui-card-body">
                <form class="layui-form" id="searchForm">
                    协议编号：
                    <div class="layui-inline" style="width: 120px;">
                        <input class="layui-input" name="search_like_string_c.contractCode" autocomplete="off">
                    </div>
                    被动迁人：
                    <div class="layui-inline" style="width: 120px;">
                        <input class="layui-input" name="search_like_string_c.name" autocomplete="off">
                    </div>

                    <button class="layui-btn" type="button" id="searchButton"><i
                                class="layui-icon layui-icon-search"></i>搜索
                    </button>
                </form>
                <table id="dataTable" class="layui-table" lay-filter="layFilter"></table>
            </div>
        </div>
    </div>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<!--序号-->
<script type="text/html" id="indexTpl">
    {{d.LAY_TABLE_INDEX+1}}
</script>
<!--菜单-->
<script type="text/html" id="dataTable_toolbar">
    {{# if(d.id != ${(contract.id)!}){ }}
    <a class="layui-btn layui-btn-xs jmdf-btn-delete" lay-event="dataTable_delete"><i
                class="layui-icon layui-icon-delete"></i>移除</a>
    {{#  } }}
</script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['table', 'form', 'jquery', 'jmdf', 'page', 'dataDict'], function () {
        var $ = layui.jquery, jmdf = layui.jmdf, page = layui.page, table = layui.table, form = layui.form, dataDict = layui.dataDict;

        form.render();

        /***********************table表格相关操作 start*************************/
        var tableRenderId = "renderId";
        var tableId = "dataTable";
        var table_layFilter = "layFilter";
        var tableUrl = "deleteAdjustAreaTableDate?contractId=" + ${(contract.id)!};

        //列项内容
        var cols = [[
            {title: "序号", toolbar: '#indexTpl', align: 'center', width: 60}
            , {field: "memo", title: "调剂记录", align: 'center', minWidth: 100}
            , {field: "adjustArea", title: "调剂面积【㎡】", align: 'center', minWidth: 150}
            , {field: "doDate", title: "调剂时间", align: 'center', minWidth: 150}
            , {field: "doName", title: "操作人", align: 'center', minWidth: 100}
            , {title: '操作', fixed: 'right', align: 'center', toolbar: '#dataTable_toolbar', width: 180}
        ]];
        //table设置项
        var options = {
            elem: '#' + tableId//table列表id值
            , url: tableUrl
            , toolbar: false
            , cols: cols
            , id: tableRenderId
            , height: 280
            , defaultToolbar: false
            , autoSort: false //禁用前端自动排序。
            , limit: 5
            , limits: [5]
        };

        //初始表格（含分页设置）
        page.render(options);
        //表格排序
        page.sort(tableId, tableRenderId);
        //刷新当前页方法封装
        page.reload();
        //分页查询（查询条件）
        $("#searchButton").click(function () {
            page.search("searchForm", tableRenderId);
        });

        table.on("tool(" + table_layFilter + ")", function (obj) {
            var data = obj.data;///获得当前行数据
            var layEvent = obj.event;//获得lay-event对应的值
            var id = data["id"];
            if (layEvent == "dataTable_delete") {
                jmdf.del("delAdjustById?adjustId=" + id);
            }
        });
    });
</script>
</body>
</html>